'''
Created on 2010/4/29

@author: Daniel
'''

class BoxScore:
    """Box Score
    """
    
    def __init__(self, boxScore={}, info ={}, gid=None):
        """
        """        
        self.boxScore = boxScore
        self.info = info
        if gid != None:
            self.gid = gid
        
    def showBoxScore(self):
        """show box score
        """
        #print self.boxScore
        if self.boxScore == {}:
            return
        #title
        print '%-20s' % self.boxScore['Title'][0],
        for i in self.boxScore['Title'][1]:
            print '%2s' % i,
        print '%2s %2s %2s' % self.boxScore['Title'][2:]
        #away
        print '%-20s' % self.boxScore['Away'][0],
        for i in self.boxScore['Away'][1:]:
            print '%2s' % i,
        print
        #home
        print '%-20s' % self.boxScore['Home'][0],
        for i in self.boxScore['Home'][1:]:
            print '%2s' % i,
        print
        
    def showInfo(self):
        """show Info
        """
        #print self.info
        if self.info == {}:
            return
        print 'WP: %s%s' % self.info['WP']
        if self.info.has_key('SV'):
            print 'SV: %s%s' % self.info['SV']
        print 'LP: %s%s' % self.info['LP']
        if self.info.has_key('HR'):
            print 'HR:',
            for p in self.info['HR']:
                print '%s %s%s' % p,
        print
        
    def showGame(self):
        """show both boxscore and info
        """
        self.showBoxScore()
        self.showInfo()

if __name__ == '__main__':
    BoxScore().showBoxScore()